package com.yanqu.road.entity.zhaoshang;

import com.alibaba.fastjson.JSON;
import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.player.UserBaseInfo;

import java.util.Objects;

/**
 * 战报
 */
public class ZsWarReport extends DataObject {

    private long projectId;     //项目id

    private int  seatId;        //占位id

    private long sitTime;       //占位时间（毫秒）

    private int  type;          //类型（0：败、1：胜、2：收官），收官不展示在客户端

    private boolean readed;     //是否已读

    private String reward;      //奖励

    private int  duration;      //占位时长（分钟）

    private int  addTime;       //新增时间（秒）

    private boolean sendReward;   //是否已发放奖励

    private int templateId;       //项目配置id

    private long enemyUserId;    //对手

    private UserBaseInfo enemyBaseInfo;

    private boolean sync;      //同步给跨服的确认

    private long userId;

    private UserBaseInfo userBaseInfo;

    private long serverId;    //跨服独有

    //-----缓存数据------
    //被抢夺者，称号是否过期，不存储，传递给日志
    private boolean decorationOver;
    //项目立项人
    private long openUserId;
    //立项人身份等级
    private int openTitleId;
    //立项人装饰
    private String openDecoration;

    public long getProjectId() {
        return projectId;
    }

    public void setProjectId(long projectId) {
        if(this.projectId != projectId) {
            this.projectId = projectId;
            setUpdateOption();
        }
    }

    public int getSeatId() {
        return seatId;
    }

    public void setSeatId(int seatId) {
        if(this.seatId != seatId) {
            this.seatId = seatId;
            setUpdateOption();
        }
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        if(this.type != type) {
            this.type = type;
            setUpdateOption();
        }
    }

    public boolean isReaded() {
        return readed;
    }

    public void setReaded(boolean readed) {
        if(this.readed != readed) {
            this.readed = readed;
            setUpdateOption();
        }
    }

    public String getReward() {
        return reward;
    }

    public void setReward(String reward) {
        if(!Objects.equals(this.reward, reward)) {
            this.reward = reward;
            setUpdateOption();
        }
    }

    public int getDuration() {
        return duration;
    }

    public void setDuration(int duration) {
        if(this.duration != duration) {
            this.duration = duration;
            setUpdateOption();
        }
    }

    public int getAddTime() {
        return addTime;
    }

    public void setAddTime(int addTime) {
        if(this.addTime != addTime) {
            this.addTime = addTime;
            setUpdateOption();
        }
    }

    public boolean isSendReward() {
        return sendReward;
    }

    public void setSendReward(boolean sendReward) {
        if(this.sendReward != sendReward) {
            this.sendReward = sendReward;
            setUpdateOption();
        }
    }

    public long getSitTime() {
        return sitTime;
    }

    public void setSitTime(long sitTime) {
        if(this.sitTime != sitTime) {
            this.sitTime = sitTime;
            setUpdateOption();
        }
    }

    public int getTemplateId() {
        return templateId;
    }

    public void setTemplateId(int templateId) {
        if(this.templateId != templateId) {
            this.templateId = templateId;
            setUpdateOption();
        }
    }

    public long getEnemyUserId() {
        return enemyUserId;
    }

    public void setEnemyUserId(long enemyUserId) {
        if(this.enemyUserId != enemyUserId) {
            this.enemyUserId = enemyUserId;
            setUpdateOption();
        }
    }

    public UserBaseInfo getEnemyBaseInfo() {
        return enemyBaseInfo;
    }

    public void setEnemyBaseInfo(UserBaseInfo enemyBaseInfo) {
        this.enemyBaseInfo = enemyBaseInfo;
        setUpdateOption();
    }

    public String getEnemyBaseInfoJsonStr(){
        if(null == enemyBaseInfo){
            return "";
        }else {
            return JSON.toJSONString(enemyBaseInfo);
        }
    }

    public boolean isSync() {
        return sync;
    }

    public void setSync(boolean sync) {
        if(this.sync != sync) {
            this.sync = sync;
            setUpdateOption();
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public UserBaseInfo getUserBaseInfo() {
        return userBaseInfo;
    }

    public void setUserBaseInfo(UserBaseInfo userBaseInfo) {
        this.userBaseInfo = userBaseInfo;
        setUpdateOption();
    }

    public String getUserBaseInfoJsonStr(){
        if(null == userBaseInfo){
            return "";
        }else {
            return JSON.toJSONString(userBaseInfo);
        }
    }

    public long getServerId() {
        return serverId;
    }

    public void setServerId(long serverId) {
        if(this.serverId != serverId) {
            this.serverId = serverId;
            setUpdateOption();
        }
    }

    public boolean isDecorationOver() {
        return decorationOver;
    }

    public void setDecorationOver(boolean decorationOver) {
        this.decorationOver = decorationOver;
    }

    public long getOpenUserId() {
        return openUserId;
    }

    public void setOpenUserId(long openUserId) {
        this.openUserId = openUserId;
    }

    public int getOpenTitleId() {
        return openTitleId;
    }

    public void setOpenTitleId(int openTitleId) {
        this.openTitleId = openTitleId;
    }

    public String getOpenDecoration() {
        return openDecoration;
    }

    public void setOpenDecoration(String openDecoration) {
        this.openDecoration = openDecoration;
    }
}
